import { useEffect } from "react";
import {Image, StyleSheet, View, Text, TouchableOpacity} from 'react-native';
import {Link, Stack, useRouter} from "expo-router";
import AntDesign from "@expo/vector-icons/AntDesign";
import {scaleSize} from "@/utils/screenSize";


export default function accountScreen() {

    const router = useRouter();

    const goCancelAccount = () => {
        router.push("/setting/account/cancelAccount")
    };

    useEffect(() => {
        // goCancelAccount();
    }, [])

    return (
        <View style={{ height: "100%", backgroundColor: "#F7F7F7" }}>
            <Stack.Screen
                options={{
                    title: '账号安全', // 设置屏幕标题
                    headerStyle: {
                        backgroundColor: '#f7f7f7', // 设置标题栏的背景颜色
                    },
                    headerShadowVisible: false, // 隐藏底部阴影和边框
                    headerBackTitleVisible: false,
                    headerTintColor: "#333",
                    headerLeft: () => (
                        <TouchableOpacity onPress={() => router.back()}>
                            <AntDesign name="left" size={19} color="#333" />
                            {/*<Ionicons name="arrow-back" size={30} color="#fff" style={{ paddingLeft: 15 }} />*/}
                        </TouchableOpacity>
                    ),
                }}
            />
            <View style={styles.settingWrap}>
                {/*<TouchableOpacity>*/}
                {/*    <View style={styles.settingItem}>*/}
                {/*        <Text style={styles.settingText}>更换手机号码</Text>*/}
                {/*        <View style={{ flexDirection: "row" }}>*/}
                {/*            <Text style={{ color: "#9C9EAC" }}>182****8753</Text>*/}
                {/*            <AntDesign name="right" size={12} color="#9C9EAC" />*/}
                {/*        </View>*/}
                {/*    </View>*/}
                {/*</TouchableOpacity>*/}
                <TouchableOpacity onPress={goCancelAccount}>
                    <View style={[styles.settingItem, styles.cleanBom]}>
                        <Text style={styles.settingText}>注销账户</Text>
                        <AntDesign name="right" size={12} color="#9C9EAC" />
                    </View>
                </TouchableOpacity>
            </View>
        </View>

    );
}

const styles = StyleSheet.create({
    settingWrap: {
        marginTop: 14,
        width: scaleSize(351),
        marginLeft: 12,
        backgroundColor: "#fff",
        borderRadius: 10,
        paddingLeft: 15,
        paddingRight: 15,
    },
    settingItem: {
        flexDirection: "row",
        height: 48,
        alignItems: "center",
        justifyContent: "space-between",
        borderBottomWidth: 0.5,
        borderBottomColor: "#E4E6EC"
    },
    cleanBom: {
        borderBottomWidth: 0
    },
    settingText: {
        fontSize: 14,
        color: "#2A2B30"
    },
    loginOut: {
        width: scaleSize(351),
        marginLeft: 12,
        height: 44,
        backgroundColor: "#fff",
        borderRadius: 10,
        marginTop: 80

    },
    loginOutText: {
        textAlign: "center",
        lineHeight: 44,
        fontSize: 14,
        color: "#333",
        fontWeight: "bold"
    },
});
